<?php
/**
 * 判断条件的控制器
 * User: huy
 * Date: 2016/7/4
 * Time: 17:07
 */
class IswhereControl extends Control{
    private $time1    = '2015-07-15 00:00:00';   //开始
    private $time2    = '2016-07-18 00:00:00';   //中间投票时间
    private $time3    = '2016-08-31 23:59:59';   //结束
    private $gamecoin = 5000;//投票每一票消耗的游戏币5000
    private $limit    = 10;   //每天最多投10票
    private $level    = 30;//参加活动的等级限制

    //构造函数
    function __construct(){
        parent::__construct();
        $this->actName = '新炫舞宝贝评选';
        load_config('commonMain/onload');
        $this->zone_arr = get_dmz_game_zone();
        load_model(ACT_NAME . '/main');   //自己的main.mod
        $this->model = new MainModel();

        //重新设置活动时间（用于外网、预发布环境）
        if(file_exists(APPLICATION_ROOT . '/config/basic.cfg.php')){
            //include文件的路径，$BasicCFG就存下了.php return 的数组
            $BasicCFG = include_once APPLICATION_ROOT . '/config/basic.cfg.php';
            if(!empty($BasicCFG[YEAR][ACT]['s_time']) && !empty($BasicCFG[YEAR][ACT]['e_time']) && $BasicCFG[YEAR][ACT]['price']){
                $this->time1    = $BasicCFG[YEAR][ACT]['time1'];
                $this->time2    = $BasicCFG[YEAR][ACT]['time2'];
                $this->time3    = $BasicCFG[YEAR][ACT]['time3'];
                $this->level    = $BasicCFG[YEAR][ACT]['level'];
                $this->gamecoin = $BasicCFG[YEAR][ACT]['gamecoin'];
                $this->money    = $BasicCFG[YEAR][ACT]['money'];
            }
        }
    }
}